package com.charlie.db;

import com.charlie.beans.Groups;
import com.charlie.beans.Product;
import com.charlie.beans.Users;
import java.sql.SQLException;
import java.util.List;
import javax.ejb.Local;

/**
 *
 @author Vitaliy Mostipaka <imprtat@gmail.com>
 */
@Local
public interface DAOLocal {
    
    public List<String> getProductsIdNameCost();

    public List<Product> getProductRange(int from, int to);

    public List<TopProduct> getProductNameSummCost(int from, int to);

    public List<String> getAllRoles();

    public List<String> getAllUsers();

    public List<String> getAllGroups();

    public String getGroupRolesNames(int groupID);
    
    public List<String> getGroupRolesNamesList(int groupID);
    
    public List<String> getRolesNotForGroup(String groupID);

    public List<ShipmentOrderData> getOrdersByFilter(String email, boolean[] status, int from, int to, long dateFrom, long dateTo);
    
    public List<ShipmentOrderData> getOrdersByEmail(String email, int from, int to);

    public List<String> getUserPersonalRolesByEmail(String email);

    public List<String> getUserGroupRolesByEmail(String email);
    
    public List<String> getUserIdByGroupId(int groupID);

    public int getUsersRoleId(int usersID, int roleID);

    public void deleteUsersRole(int usersID, int roleID);
    
    public void deleteGroupsRole(int groupsID, int roleID); 
    
    public void deleteUsersGroups(int groupsID, int usersID) throws SQLException;
    
    public void deleteUsersGroups(int groupsID) throws SQLException;

    public FieldDescription getFildsDescription(String table, String field);

    /**
     *
     * @param from
     * @param to
     * @return
     */
    public List<Groups> getGroupsRange(int from, int to);

    public List<Users> getUsersRange(int from, int to);
    
    public String getHash(String email);
    
    public int getUserOrdersCount(String email);
    
}
